package account

import (
	"fmt"
	"io"
	"net/http"

	"github.com/gin-gonic/gin"
)

func Amisjson(c *gin.Context) {
	res, err := http.Get("https://aisuda.bce.baidu.com/amis/api/mock2/sample")

	if err != nil {
		fmt.Println("found error:", err)
		return
	}

	defer res.Body.Close()

	// 读取响应体数据
	body, err := io.ReadAll(res.Body)
	if err != nil {
		fmt.Println("读取响应体数据错误:", err)
		return
	}

	c.String(http.StatusOK, string(body))
}
